<?php
/**
* Real Estate Management Item
* @version 1.0
* @since Apr 2, 2011
* For HuyBDS Project
*/
class rsmanage_item {
	
    function ward_form($object) {
		if (!defined('SYS_FORMS')) require_once(BASE.'subsystems/forms.php');
		exponent_forms_initialize();

		$form = new form();
		if (!isset($object->id)) {
            $object->name="";
			$object->shortname="";
		} else {
			$form->meta('id',$object->id);
		}
        
        $form->register('name','Name',new textcontrol($object->name));
		$form->register('short_name','Short name',new textcontrol($object->shortname));
        
		$form->register('submit','',new buttongroupcontrol('Save','','Cancel'));
		return $form;
	}

	function ward_update($values,$object) {
        $object->name= $values['name'];
        if (trim($values['short_name']) == "")
        {
            $values['short_name']=$values['name'];
        }
		$object->shortname= _to_vietnamese_with_nomark(_ab_safe_html_string($values['short_name']));
        
		return $object;
	}
}

?>